package com.jm.entity;
// Generated 2018-1-17 21:56:33 by Hibernate Tools 5.2.3.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Order generated by hbm2java
 */
@Entity
@Table(name = "order", catalog = "wxjm")
public class Order implements java.io.Serializable {

	private Long id;
	private User user;
	private String ordernumber;
	private Integer statue;
	private Integer pcount;
	private String paypic;
	private Date ordertime;
	private Set<Orderitem> orderitems = new HashSet<Orderitem>(0);

	public Order() {
	}

	public Order(String ordernumber) {
		this.ordernumber = ordernumber;
	}

	public Order(User user, String ordernumber, Integer statue, Integer pcount, String paypic, Date ordertime,
			Set<Orderitem> orderitems) {
		this.user = user;
		this.ordernumber = ordernumber;
		this.statue = statue;
		this.pcount = pcount;
		this.paypic = paypic;
		this.ordertime = ordertime;
		this.orderitems = orderitems;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "ordernumber", nullable = false)
	public String getOrdernumber() {
		return this.ordernumber;
	}

	public void setOrdernumber(String ordernumber) {
		this.ordernumber = ordernumber;
	}

	@Column(name = "statue")
	public Integer getStatue() {
		return this.statue;
	}

	public void setStatue(Integer statue) {
		this.statue = statue;
	}

	@Column(name = "pcount")
	public Integer getPcount() {
		return this.pcount;
	}

	public void setPcount(Integer pcount) {
		this.pcount = pcount;
	}

	@Column(name = "paypic")
	public String getPaypic() {
		return this.paypic;
	}

	public void setPaypic(String paypic) {
		this.paypic = paypic;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ordertime", length = 19)
	public Date getOrdertime() {
		return this.ordertime;
	}

	public void setOrdertime(Date ordertime) {
		this.ordertime = ordertime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "order")
	public Set<Orderitem> getOrderitems() {
		return this.orderitems;
	}

	public void setOrderitems(Set<Orderitem> orderitems) {
		this.orderitems = orderitems;
	}

}
